package com.web.serviceimpl;

import com.web.dao.TeacherDao;
import com.web.daoimpl.TeacherDaoImpl;
import com.web.entity.Teacher;
import com.web.service.TeacherService;

/**
 * 
 * @author 12270
 */
public class TeacherServiceImpl implements TeacherService{

    TeacherDao teacherDao = new TeacherDaoImpl();    
    
    @Override
    public Teacher valedateLogin(String Tid, String Tpwd) {
        Teacher t = teacherDao.getOneByTid(Tid);
        if(null!=t&&t.getTpwd().equals(Tpwd))
            return t;
        else{
            return null;
        }
    }

    @Override
    public Teacher findTeacherByTid(String Tid) {
        return teacherDao.getOneByTid(Tid);
    }

    @Override
    public int modifyTeacherInfo(Teacher t) {
        return teacherDao.update(t);
    }
    
    @Override
    public int modifyTeacherTpwd(Teacher t) {
        return teacherDao.updateTpwd(t);
    }
}
